import { createSlice } from "@reduxjs/toolkit";

interface list {
  id: number;
  text: string;
}

const initialState: {
  list: list[];
} = {
  list: [
    {
      id: 1,
      text: "123",
    },
  ],
};

export const listSlice = createSlice({
  name: "list",
  initialState,
  reducers: {
    addList: (state, action) => {
      console.log(action.payload);
      state.list.push(action.payload);
      return state;
    },
  },
  extraReducers: (builder) => {},
});
